<?

include_once "libphp/libmysql.php";

$path = $_POST['path'];
$encoded = base64_decode($_POST['content']);

if ($path != null) {
	print "* [ajax] saving [$path].";

	/* for demonstration.. */
	$encoded = str_replace("<rrid>default</rrid>", "<rrid>AKIAIHXRZUV7K7Q7JZ7A</rrid>", $encoded);
	$encoded = str_replace("<rrkey>default</rrkey>", "<rrkey>ZDijBdROJrc6TViueBWYVhD5o8hSVzv9Civaj+Zl</rrkey>", $encoded);

	$fp = fopen($path, "w");
	fwrite($fp, $encoded, strlen($encoded));
	fclose($fp);
}
else {
	print "! invalid arguments.<br>";
	print "- path: $path<br>";
	print "- xml: $xml<br>";

}

?>


